package com.sx.water.modules.Controller;

import com.sx.water.modules.sever.RainQuartzServer;
import com.sx.water.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @description: 查询超阀值数据
 * @author: taoxi
 * @create: 2018-12-07 15:51
 **/
@RestController
@CrossOrigin
@RequestMapping(value = "/rain")
public class RainQuartzController {
     @Autowired
     private RainQuartzServer rainQuartzServer;

    /**
     * @param pre  阀值
     * @param num  1/3/6
     * @return
     */
    @CrossOrigin
    @RequestMapping("/GetPre")
    public R SurfaceRainfall(@RequestParam(value = "pre") String pre,@RequestParam(value = "num") int num) {
        Map<String,Object> objectMap=rainQuartzServer.RainFallPre1(pre,num);
        return R.ok().put("DS", objectMap);
    }
}
